//
//  BaseTableViewController.swift
//  swift新浪微博
//
//  Created by sunchanggui on 15/7/29.
//  Copyright © 2015年 sunchanggui. All rights reserved.
//

import UIKit

class BaseTableViewController: UITableViewController, VisitorLoginViewDelegate {
    
    var userLogin = false
    
    var visitorLoginView: VisitorLoginView?

    override func loadView() {
        if userLogin {
            super.loadView()
            return
        }
        
        visitorLoginView = NSBundle.mainBundle().loadNibNamed("VisitorLoginView", owner: nil, options: nil).last as? VisitorLoginView
        // view.backgroundColor = UIColor.whiteColor()
        visitorLoginView?.delegate = self
        
        view = visitorLoginView
        
        self.navigationItem.rightBarButtonItem = UIBarButtonItem(title: "登录", style: UIBarButtonItemStyle.Done, target: self, action: "loginVisitorLoginViewDidSeleted")
        
        self.navigationItem.leftBarButtonItem = UIBarButtonItem(title: "注册", style: UIBarButtonItemStyle.Done, target: self, action: "registerVisitorLoginViewDidSeleted")

    }
    
    func loginVisitorLoginViewDidSeleted() {
        print(__FUNCTION__)
    }
    
    func registerVisitorLoginViewDidSeleted() {
        print(__FUNCTION__)
    }

}
